<!--
 * @Author: Li Zengkun
 * @Date: 2022-09-28 15:05:03
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-28 15:58:08
 * @Description: 
-->
<template>
  <div>
    <el-card>
      <template #header>
        <span>订单列表</span>
      </template>
    </el-card>
    <el-table
      :data="orderList"
      style="width: 100%"
      highlight-current-row
      stripe
    >
      <el-table-column label="#" prop="id" width="60"></el-table-column>
      <el-table-column label="商品名称" width="600">
        <template #default="scope">
          <el-table border :data="scope.row.goodsList">
            <el-table-column label="商品" width="400">
              <template #default="scope">
                <div style="display:flex">
                  <img style="width: 80px;margin-right:10px" :src="scope.row.img_md" alt="" />
                  <p>{{ scope.row.name }}</p>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="单价" prop="goods_price"></el-table-column>
            <el-table-column label="数量" prop="goods_num"></el-table-column>
          </el-table>
        </template>
      </el-table-column>
      <el-table-column prop="payment" label="付款总额" width="120" sortable />
      <el-table-column
        prop="create_time"
        label="下单时间"
        width="180"
        sortable
      />
      <el-table-column prop="status" label="状态" width="180" sortable />
      <el-table-column label="操作">
        <template #default="scope">
          <el-button type="primary" @click="handleEdit(scope.row)"
            >编辑</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
 
<script setup>
import { ref, reactive } from "vue";
import { order } from "@/api";

const resp = await order.getAll({ type: "tree" });

const orderList = resp.data;

console.log(orderList);
</script>

<style lang='less' scoped>
</style>

